package com.yuyu.demo.demo_springboot.exception;

import com.yuyu.demo.demo_springboot.enums.ResultEnum;

/**
 * Spring中runtimeException才会事务回滚，其它不会
 * @author yuyu
 *
 */
public class GirlException extends RuntimeException {
	private static final long serialVersionUID = 1L;
	private Integer code;
	
	public GirlException(ResultEnum reEnum) {
		super(reEnum.getMsg());
		this.code = reEnum.getCode();
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}
	
	
}
